var mongoose = require("mongoose");

//二级评论表(comfabulous)

var comfabulousSchema = new mongoose.Schema({
  userid: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "user_login",
    required: true
  }, //用户id
  commentid: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "comment",
    required: true
  }, //评论id
  replyid: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: "user_login",
    required: true
  }, //回复的人
  // commenttype: { type: String, required: true }, //评论类型 评论/二级评论
  content: {
    type: String,
    required: true
  }, //评论内容
  release_time: {
    type: Date,
    default: new Date()
  } //发布时间
});

module.exports = mongoose.model("comfabulous", comfabulousSchema);